Những câu hỏi liên quan
Đăng Phạm Khắc
Xem chi tiết
Đạt Nguyễn
Xem chi tiết
Minh Lệ
25 tháng 5 2021 lúc 10:47

Program HOC24;

var a: array[1..32000] of string;

d,i,n: integer;

begin

write('Nhap N: '); readln(n);

for i:=1 to n do

begin

 write('a[',i,']='); readln(a[i]);

end;

d:=0;

for i:=1 to n do

if length(a[i]) = 3 then d:=d+1;

write('Co ',d,' so co 3 chu so trong day');

readln

end.

Bình luận (0)
phamthiminhanh
Xem chi tiết
Nguyễn Lê Phước Thịnh
20 tháng 1 2021 lúc 20:13

Câu 1: 

uses crt;

var a,b:integer;

begin

clrscr;

write('Nhap a='); readln(a);

write('Nhap b='); readln(b);

if (a>0) and (b>0) then writeln('Cung duong');

if (a<0) and (b<0) then writeln('Cung am');

if (a>0) and (b<0) then writeln('Duong am');

if (a<0) and (b>0) then writeln('Am duong');

readln;

end.

Câu 2: 

uses crt;

var a,b:integer;

begin

clrscr;

write('Nhap a='); readln(a);

write('Nhap b='); readln(b);

if (a mod 2=0) and (b mod 2=0) then writeln('Cung chan');

if (a mod 2<>0) and (b mod 2<>0) then writeln('Cung le');

if (a mod 2=0) and (b mod 2<>0) then writeln('Chan le');

if (a mod 2<>0) and (b mod 2=0) then writeln('Le chan');

readln;

end.

Bình luận (1)
Bình Lưu
Xem chi tiết
Nguyễn Quốc Đạt
6 tháng 10 2023 lúc 19:27

#include <bits/stdc++.h>

using namespace std;

int main() {

long long n;

cin >> n;

int can = (long long)(sqrt(n));

cout << n + can;

return 0; 

 } 

Bình luận (0)
lê anh khôi
Xem chi tiết
lê anh khôi
6 tháng 3 2021 lúc 15:00

ai làm giúp mình

 

Bình luận (0)
luu tean khanh
Xem chi tiết
Phía sau một cô gái
27 tháng 2 2023 lúc 19:46

var A:

     array[1..n] of int64;

     i, n, count: integer;

begin

     write('Nhap so phan tu cua mang: ');

     readln(n);

     for i := 1 to n do

     begin

          write('Nhap phan tu thu ', i, ': ');

          readln(A[i]);

      end;

 

     count := 0;

     for i := 1 to n do

          if A[i] > 0 then

               count := count + 1;

     writeln('So luong cac so nguyen duong trong mang la: ', count); end.

Bình luận (0)
Trung Kiên Lưu
Xem chi tiết
Nguyễn Lê Phước Thịnh
16 tháng 1 2022 lúc 13:36

const fi='dataln.txt'

fo='dataout.txt'

var f1,f2:text;

x,i,t:integer;

begin

assign(f1,fi); reset(f1);

assign(f2,fo); rewrite(f2);

t:=0;

for i:=1 to 24 do 

begin

read(f1,x);

t:=t+x;

end;

writeln(f2,t);

close(f1);

close(f2);

end.

Bình luận (0)
Nguyễn Minh Doanh
Xem chi tiết
Nguyễn Lê Phước Thịnh
16 tháng 3 2021 lúc 21:36

uses crt;

var n,i,d,max,x,y:integer;

st:string;

begin

clrscr;

write('Nhap n='); readln(n);

str(n,st);

d:=length(st);

max:=0;

for i:=1 to d do 

  begin

val(st[i],x,y);

if max<x then max:=x;

end;

writeln(max);

readln;

end.

Bình luận (0)
Đào Khánh Thy
Xem chi tiết

Ngôn ngữ: C++

#include <bits/stdc++.h>

using namespace std;
long long a[1000000];
long long n,m,d;
int main()
{
    cin>>n>>m;
    for(int i=1;i<=n;i++){
        long long tmp;
        cin>>tmp;
        a[i]=a[i-1]+tmp;
    }
    for(int i=1;i<n;i++){
        for(int j=i+1;j<=n;j++){
            if(a[j]-a[i-1]<=m){d++;}
        }
    }
    cout<<d;
    return 0;
}

Bình luận (1)